package com.test.mapper;

import com.test.entity.Book;
import org.apache.ibatis.annotations.*;

@Mapper
public interface BookMapper {

    @Select("select * from DB_BOOK where bid = #{bid}")
    Book getBookById(@Param("bid") int bid);

    @Select("select count from DB_BOOK  where bid = #{bid}")
    int getRemain(@Param("bid") int bid);

    @Update("update DB_BOOK set count = #{count}  where bid = #{bid}")
    int setRemain(@Param("bid") int bid, @Param("count") int count);

}